package com.dagger.weapon.service.impl;

import com.dagger.weapon.dao.ChannelsMapper;
import com.dagger.weapon.entity.Channels;
import com.dagger.weapon.service.ChannelsService;
import com.dagger.weapon.vo.ResStatus;
import com.dagger.weapon.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChannelsServiceImpl implements ChannelsService {

    @Autowired
    private ChannelsMapper channelsMapper;

    @Override
    public ResultVO listChannels() {
        List<Channels> channels = channelsMapper.listChannels();
        if (channels.size()==0){
            return new ResultVO(ResStatus.NO,"fail",null);
        }else {
            return new ResultVO(ResStatus.OK,"success",channels);
        }
    }
}
